﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using LPTask.Interfaces.Views;

namespace LPTask.UI
{
    public partial class FormMain : Form
    {
        public event EventHandler ActiveTaskChangeNeeded;
        public event EventHandler SolveTaskNeeded;

        private IUserMessageView _userMessageView;

        public string SelectedTaskName
        {
            get { throw new NotImplementedException(); }
        }

        public FormMain()
        {
            InitializeComponent();
            Text = "LPTask " + Application.ProductVersion;
            _userMessageView = WinFormsViewManager.Instance.UserMessageView;
        }

        public void SetTaskNames(List<string> taskNames)
        {
            cbTasks.Items.AddRange(taskNames.ToArray());
        }

        public void SetActiveTaskView(ITaskView taskView)
        {
            throw new NotImplementedException();
        }
        
        private void OnSolveTaskNeeded()
        {
            if (SolveTaskNeeded != null)
            {
                SolveTaskNeeded(this, EventArgs.Empty);
            }
        }

        private void оПрограммеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormAbout formAbout = new FormAbout();
            formAbout.ShowDialog();

        }

        private void выходToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}